package cn.dujc.superkid.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author du
 * date 2018/7/29 下午7:20
 */
public class CourseEntity implements Parcelable {
    /**
     * id : 25
     * title : 圆和扇形01
     * course_num : 10
     * study_num : 145
     * cover : http://api.niuwaketang.com/public/cover/1.jpg
     * course_type : 七年级数学|七年级几何
     */

    private String id;//课程id
    private String title;//课程标题
    private String course_num;//课程数量
    private String study_num;//学习人数
    private String cover;//封面
    private String course_type;//课程类型（可能为数组）
    
    /**
     * grade : 3
     * junior_id : 1
     */
    private String grade;//所属年级id
    private String junior_id;//科目id

    public String getId() { return id;}

    public void setId(String id) { this.id = id;}

    public String getTitle() { return title;}

    public void setTitle(String title) { this.title = title;}

    public String getCourse_num() { return course_num;}

    public void setCourse_num(String course_num) { this.course_num = course_num;}

    public String getStudy_num() { return study_num;}

    public void setStudy_num(String study_num) { this.study_num = study_num;}

    public String getCover() { return cover;}

    public void setCover(String cover) { this.cover = cover;}

    public String getCourse_type() { return course_type;}

    public void setCourse_type(String course_type) { this.course_type = course_type;}

    public String getGrade() { return grade;}

    public void setGrade(String grade) { this.grade = grade;}

    public String getJunior_id() { return junior_id;}

    public void setJunior_id(String junior_id) { this.junior_id = junior_id;}

    @Override
    public int describeContents() { return 0; }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.title);
        dest.writeString(this.course_num);
        dest.writeString(this.study_num);
        dest.writeString(this.cover);
        dest.writeString(this.course_type);
        dest.writeString(this.grade);
        dest.writeString(this.junior_id);
    }

    public CourseEntity() {}

    protected CourseEntity(Parcel in) {
        this.id = in.readString();
        this.title = in.readString();
        this.course_num = in.readString();
        this.study_num = in.readString();
        this.cover = in.readString();
        this.course_type = in.readString();
        this.grade = in.readString();
        this.junior_id = in.readString();
    }

    public static final Creator<CourseEntity> CREATOR = new Creator<CourseEntity>() {
        @Override
        public CourseEntity createFromParcel(Parcel source) {return new CourseEntity(source);}

        @Override
        public CourseEntity[] newArray(int size) {return new CourseEntity[size];}
    };

    @Override
    public String toString() {
        return "CourseEntity{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", course_num='" + course_num + '\'' +
                ", study_num='" + study_num + '\'' +
                ", cover='" + cover + '\'' +
                ", course_type='" + course_type + '\'' +
                ", grade='" + grade + '\'' +
                ", junior_id='" + junior_id + '\'' +
                '}';
    }
}
